#!/usr/bin/env python3
# coding:utf-8

from flask import Flask

app = Flask(__name__)


@app.route("/blog/<int:postID>")
def show_blog(postID):
    return "Blog Number %d" % postID


@app.route("/rev/<float:revNo>")
def revision(revNo):
    return "Revision Number %f" % revNo


@app.route("/flask")
def hello_flask():
    return "Hello Flask"
# http://127.0.0.1:8080/flask  --OK
# http://127.0.0.1:8080/flask/ --NG, 404 Not Found


@app.route("/python/")
def hello_python():
    return "Hello Python"
# http://127.0.0.1:8080/python --> 自动转为 http://127.0.0.1:8080/python/

any_ip = "0.0.0.0"
http_port = 8080
if __name__ == "__main__":
    app.run(any_ip, http_port)

""" RUN
url: http://127.0.0.1:8080/blog/19
Blog Number 123

url: http://127.0.0.1:8080/rev/3.14
Revision Number 3.140000
"""
